package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_replies")
public class RepliesBean {
    @TableId(value = "pk_repliesId", type = IdType.AUTO)
    private Integer id;
    @TableField("r_title")
    private String title;
    @TableField("r_content")
    private String content;
    @TableField("r_author")
    private String author;
    @TableField("r_date")
    private LocalDate date = LocalDate.now();
    @TableField("fk_mainPostId")
    private Integer mainPostId;

    public RepliesBean() {
    }

    public RepliesBean(String title, String content, Integer mainPostId) {
        this.title = title;
        this.content = content;
        this.mainPostId = mainPostId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getMainPostId() {
        return mainPostId;
    }

    public void setMainPostId(Integer mainPostId) {
        this.mainPostId = mainPostId;
    }

    @Override
    public String toString() {
        return "RepliesBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", author='" + author + '\'' +
                ", date=" + date +
                ", mainPostId=" + mainPostId +
                '}';
    }
}
